<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var point = {
        x: 0,
        y: 0,
        moveTo: function(x, y) {
          var that = this

          var moveX = function(x) {
            that.x = x // point.x = 1
          }
          var moveY = function(y) {
            that.y = y // point.y = 1
          }
          moveX(x)
          moveY(y)
        }
      }
      point.moveTo(1, 1)
      console.log(point.x) // 1
      console.log(point.y) // 1
      console.log(x) // x is not defined
      console.log(y) // y is not defined 这个错误不会爆出来,因为上面就已经报错了
    </script>
  </body>
</html>
